</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
	<h2 class="u-tt">系统设置</h2>
	<ul id="tabs">
		<li> <a class="z-crt" href="#tab1"><span class="icon">&#xf05a;</span> 站点信息</a></li>
		<li> <a href="#tab2"> <span class="icon">&#xf0e4;</span> 性能设置</a></li>
		<li> <a href="#tab3"> <span class="icon">&#xf06e;</span> 模板设置</a></li>
		<li> <a href="#tab4"><span class="icon">&#xf01b;</span> 上传设置</a></li>
	</ul>
</div>
<div class="f-sep10"></div>
<div class="m-form">
	<form name="xxx" action="{$url(setting/save_config)}" method="post" id="form">
		<fieldset>
			<div id="tab1">
				<div class="formitm">
					<label class="lab" >网站名称：</label>
					<div class="ipt">
						<input name="INFO[sitename]" type="text" class="u-ipt" value="<?php echo $config['INFO']['sitename']; ?>" />
						<span class="Validform_checktip">显示在网站头部的标题信息</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >网站副标题：</label>
					<div class="ipt">
						<input name="INFO[seoname]" type="text" class="u-ipt" value="<?php echo $config['INFO']['seoname']; ?>" />
						<span class="Validform_checktip">针对SEO优化的标题后缀</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >网站域名：</label>
					<div class="ipt">
						<input name="INFO[siteurl]" type="text" class="u-ipt" value="<?php echo $config['INFO']['siteurl']; ?>" />
						<span class="Validform_checktip">只作为信息显示，不作为系统配置</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >站点关键词：</label>
					<div class="ipt">
						<input name="INFO[keywords]" type="text" class="u-ipt" value="<?php echo $config['INFO']['keywords']; ?>" />
						<span class="Validform_checktip">针对搜索引擎的站点关键词</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >站点描述：</label>
					<div class="ipt">
						<textarea name="INFO[description]" class="u-itt" ><?php echo $config['INFO']['description']; ?></textarea>
						<span class="Validform_checktip">针对搜索引擎的站点简介信息</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >站长邮箱：</label>
					<div class="ipt">
						<input name="INFO[masteremail]" type="text" class="u-ipt" value="<?php echo $config['INFO']['masteremail']; ?>" />
						<span class="Validform_checktip">显示在网站底部的站长邮箱</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >版权信息：</label>
					<div class="ipt">
						<input name="INFO[copyright]" type="text" class="u-ipt" value="<?php echo $config['INFO']['copyright']; ?>" />
						<span class="Validform_checktip">显示在网站底部的网站版权信息</span> </div>
				</div>
			</div>
			<div id="tab2">
				<div class="formitm">
					<label class="lab">错误调试模式：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['APP']['DEBUG']){ ?>
							<input type="radio" name="APP[DEBUG]" value="true"  checked="checked" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="APP[DEBUG]" value="false"  />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio"  name="APP[DEBUG]" value="true" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio"  name="APP[DEBUG]" value="false"  checked="checked"  />
							<label>关闭</label>
							<?php }?>
						</div>
						<span class="Validform_checktip">开启后将显示详细的错误信息</span> </div>
				</div>
				<div class="formitm">
					<label class="lab">伪静态模式：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['APP']['URL_REWRITE_ON']){ ?>
							<input type="radio" name="APP[URL_REWRITE_ON]" value="true" checked="checked" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="APP[URL_REWRITE_ON]" value="false"  />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio" name="APP[URL_REWRITE_ON]" value="true" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="APP[URL_REWRITE_ON]" value="false"  checked="checked" />
							<label>关闭</label>
							<?php }?>
						</div>
						<span class="Validform_checktip">开启后将会去除URL中的index.php</span> </div>
				</div>
				<div class="formitm">
					<label class="lab">智能生成静态：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['APP']['HTML_CACHE_ON']){ ?>
							<input type="radio" name="APP[HTML_CACHE_ON]" value="true" checked="checked"/>
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="APP[HTML_CACHE_ON]" value="false" />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio" name="APP[HTML_CACHE_ON]" value="true" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="APP[HTML_CACHE_ON]" value="false"  checked="checked" />
							<label>关闭</label>
							<?php }?>
						</div>
						<span class="Validform_checktip">针对页面访问进行一定时间的静态缓存</span> </div>
				</div>
				<div class="formitm">
					<label class="lab">数据库缓存：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['DB']['DB_CACHE_ON']){ ?>
							<input type="radio" name="DB[DB_CACHE_ON]" value="true"   checked="checked"/>
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="DB[DB_CACHE_ON]" value="false" />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio" name="DB[DB_CACHE_ON]" value="true" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="DB[DB_CACHE_ON]" value="false"  checked="checked" />
							<label>关闭</label>
							<?php }?>
						</div>
						<span class="Validform_checktip">缓存数据库查询信息减少数据库压力</span> </div>
				</div>
				<div class="formitm">
					<label class="lab">模板缓存：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['TPL']['TPL_CACHE_ON']){ ?>
							<input type="radio" name="TPL[TPL_CACHE_ON]" value="true" checked="checked" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="TPL[TPL_CACHE_ON]" value="false" />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio" name="TPL[TPL_CACHE_ON]" value="true"  />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="TPL[TPL_CACHE_ON]" value="false" checked="checked"  />
							<label>关闭</label>
							<?php }?>
						</div>
						<span class="Validform_checktip">减少模板重复编译次数</span> </div>
				</div>
                <div class="formitm">
					<label class="lab" >COOKIE标识：</label>
					<div class="ipt">
						<input name="APP[COOKIE_PREFIX]" type="text" class="u-ipt" value="<?php echo $config['APP']['COOKIE_PREFIX']; ?>" />
						<span class="Validform_checktip">如果一个空间多个网站请自行调整本参数</span> </div>
				</div>
			</div>
			<div id="tab3">
				<div class="formitm">
					<label class="lab" >模板路径：</label>
					<div class="ipt">
						<input name="TPL[TPL_TEMPLATE_NAME]" id="TPL_TEMPLATE_NAME" type="text" class="u-ipt" value="<?php echo $config['TPL']['TPL_TEMPLATE_NAME']; ?>" />
						<span class="Validform_checktip">位于themes目录下的模板文件夹</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >首页模板：</label>
					<div class="ipt">
						<input name="TPL[TPL_TEMPLATE_INDEX]" id="TPL_TEMPLATE_INDEX" type="text" class="u-ipt" value="<?php echo $config['TPL']['TPL_TEMPLATE_INDEX']; ?>" />
						<span class="Validform_checktip">针对模板目录下的首页文件</span> </div>
                        
				</div>
				<div class="formitm">
					<label class="lab" >公共模板：</label>
					<div class="ipt">
						<input name="TPL[TPL_TEMPLATE_COMMON]" id="TPL_TEMPLATE_COMMON" type="text" class="u-ipt" value="<?php echo $config['TPL']['TPL_TEMPLATE_COMMON']; ?>" />
						<span class="Validform_checktip">用于表单等模块的公共模板</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >搜索模板：</label>
					<div class="ipt">
						<input name="TPL[TPL_TEMPLATE_SEARCH]" id="TPL_TEMPLATE_SEARCH" type="text" class="u-ipt" value="<?php echo $config['TPL']['TPL_TEMPLATE_SEARCH']; ?>" />
						<span class="Validform_checktip">搜索列表的模板</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >TAG首页模板：</label>
					<div class="ipt">
						<input name="TPL[TPL_TEMPLATE_TAG_INDEX]" id="TPL_TEMPLATE_TAG_INDEX"  type="text" class="u-ipt" value="<?php echo $config['TPL']['TPL_TEMPLATE_TAG_INDEX']; ?>" />
						<span class="Validform_checktip">TAG首页列表的模板</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >TAG列表模板：</label>
					<div class="ipt">
						<input name="TPL[TPL_TEMPLATE_TAG]" id="TPL_TEMPLATE_TAG"  type="text" class="u-ipt" value="<?php echo $config['TPL']['TPL_TEMPLATE_TAG']; ?>" />
						<span class="Validform_checktip">TAG内容列表的模板</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >TAG首页分页数：</label>
					<div class="ipt">
						<div class="txt">
							<input name="TPL[TPL_TEMPLATE_TAG_INDEX_PAGE]" type="text" class="u-ipt u-ipt-1" value="<?php echo $config['TPL']['TPL_TEMPLATE_TAG_INDEX_PAGE']; ?>" />
						</div>
						<span class="Validform_checktip">TAG首页每页数量</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >TAG列表分页数：</label>
					<div class="ipt">
						<div class="txt">
							<input name="TPL[TPL_TEMPLATE_TAG_PAGE]" type="text" class="u-ipt u-ipt-1" value="<?php echo $config['TPL']['TPL_TEMPLATE_TAG_PAGE']; ?>" />
						</div>
						<span class="Validform_checktip">TAG内容列表每页数量</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >搜索列表分页数：</label>
					<div class="ipt">
						<div class="txt">
							<input name="TPL[TPL_TEMPLATE_SEARCH_PAGE]" type="text" class="u-ipt u-ipt-1" value="<?php echo $config['TPL']['TPL_TEMPLATE_SEARCH_PAGE']; ?>" />
						</div>
						<span class="Validform_checktip">搜索结果的每页数量</span> </div>
				</div>
			</div>
			<div id="tab4">
				<div class="formitm">
					<label class="lab" >默认缩图方式：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['UPLOAD']['THUMBNAIL_TYPE']){ ?>
							<input type="radio" name="UPLOAD[THUMBNAIL_TYPE]" value="true" checked="checked" />
							<label>裁剪</label>
							&nbsp;&nbsp;
							<input type="radio" name="UPLOAD[THUMBNAIL_TYPE]" value="false" />
							<label>按比例</label>
							<?php }else{?>
							<input type="radio" name="UPLOAD[THUMBNAIL_TYPE]" value="true"  />
							<label>裁剪</label>
							&nbsp;&nbsp;
							<input type="radio" name="UPLOAD[THUMBNAIL_TYPE]" value="false" checked="checked"  />
							<label>按比例</label>
							<?php }?>
						</div>
						<span class="Validform_checktip">只针对图片处理默认选项</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >默认缩图开关：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['UPLOAD']['THUMBNAIL_ON']){ ?>
							<input type="radio" name="UPLOAD[THUMBNAIL_ON]" value="true" checked="checked" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="UPLOAD[THUMBNAIL_ON]" value="false" />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio" name="UPLOAD[THUMBNAIL_ON]" value="true"  />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="UPLOAD[THUMBNAIL_ON]" value="false" checked="checked"  />
							<label>关闭</label>
							<?php } ?>
						</div>
						<span class="Validform_checktip">只针对图片处理默认选项</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >默认缩图尺寸：</label>
					<div class="ipt">
						<div class="txt">
							<label>宽度：</label>
							<input name="UPLOAD[THUMBNAIL_WIDTH]" type="text" class="u-ipt u-ipt-1" value="<?php echo $config['UPLOAD']['THUMBNAIL_WIDTH']; ?>" />
							&nbsp;&nbsp;
							<label>高度：</label>
							<input name="UPLOAD[THUMBNAIL_HEIGHT]" type="text" class="u-ipt u-ipt-1" value="<?php echo $config['UPLOAD']['THUMBNAIL_HEIGHT']; ?>" />
						</div>
						<span class="Validform_checktip">单位：像素</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >默认水印开关：</label>
					<div class="ipt">
						<div class="txt">
							<?php if($config['UPLOAD']['WATERMARK_ON']){ ?>
							<input type="radio" name="UPLOAD[WATERMARK_ON]" value="true" checked="checked" />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="UPLOAD[WATERMARK_ON]" value="false" />
							<label>关闭</label>
							<?php }else{?>
							<input type="radio" name="UPLOAD[WATERMARK_ON]" value="true"  />
							<label>开启</label>
							&nbsp;&nbsp;
							<input type="radio" name="UPLOAD[WATERMARK_ON]" value="false" checked="checked"  />
							<label>关闭</label>
							<?php } ?>
							&nbsp;&nbsp;
							<label>水印位置：</label>
							<select name="UPLOAD[WATERMARK_POSITION]">
								<option value="0" <?php if($config['UPLOAD']['WATERMARK_POSITION']==0){ ?> selected="selected" <?php } ?>>随机</option>
								<option value="1" <?php if($config['UPLOAD']['WATERMARK_POSITION']==1){ ?> selected="selected" <?php } ?> >左上</option>
								<option value="2" <?php if($config['UPLOAD']['WATERMARK_POSITION']==2){ ?> selected="selected" <?php } ?> >中上</option>
								<option value="3" <?php if($config['UPLOAD']['WATERMARK_POSITION']==3){ ?> selected="selected" <?php } ?>>右上</option>
								<option value="4" <?php if($config['UPLOAD']['WATERMARK_POSITION']==4){ ?> selected="selected" <?php } ?>>左中</option>
								<option value="5" <?php if($config['UPLOAD']['WATERMARK_POSITION']==5){ ?> selected="selected" <?php } ?>>正中</option>
								<option value="6" <?php if($config['UPLOAD']['WATERMARK_POSITION']==6){ ?> selected="selected" <?php } ?>>右中</option>
								<option value="7" <?php if($config['UPLOAD']['WATERMARK_POSITION']==7){ ?> selected="selected" <?php } ?>>左下</option>
								<option value="8" <?php if($config['UPLOAD']['WATERMARK_POSITION']==8){ ?> selected="selected" <?php } ?>>中下</option>
								<option value="9" <?php if($config['UPLOAD']['WATERMARK_POSITION']==9){ ?> selected="selected" <?php } ?>>右下</option>
							</select>
						</div>
						<span class="Validform_checktip">只针对图片处理默认选项</span> </div>
				</div>
				<div class="formitm">
					<label class="lab" >水印图片：</label>
					<div class="ipt">
						<input name="UPLOAD[WATERMARK_IMAGE]" type="text" class="u-ipt" value="<?php echo $config['UPLOAD']['WATERMARK_IMAGE']; ?>" />
						<span class="Validform_checktip">位于public/watermark下的图片文件</span> </div>
				</div>
                <div class="formitm">
					<label class="lab" >上传格式：</label>
					<div class="ipt">
						<input name="UPLOAD[UPLOAD_TYPE]" type="text" class="u-ipt" value="<?php echo $config['UPLOAD']['UPLOAD_TYPE']; ?>" />
						<span class="Validform_checktip">系统会自动过滤危险文件</span> </div>
				</div>
                <div class="formitm">
					<label class="lab" >上传大小：</label>
					<div class="ipt">
						<input name="UPLOAD[UPLOAD_SIZE]" type="text" class="u-ipt" value="<?php echo $config['UPLOAD']['UPLOAD_SIZE']; ?>" />
						<span class="Validform_checktip">单位：M 程序限制上传大小，服务器限制请自行调整</span> </div>
				</div>
			</div>
			<div class="formitm formitm-1">
				<button class="u-btn" id="submit" type="submit">保存修改</button> 
                <button class="u-btn u-btn-c4" id="reset" type="button">重置</button>
                <span id="tip" class="load"></span>

			</div>
		</fieldset>
	</form>
</div>
</body>
<script>
var tpl_val = new function(){}; 
Do.ready('base','form','tabs','tip', function() {
	saveform();
	tabs();
	//模板赋值
	window.tpl_val = function tpl_val(id,val){
			$('#'+id).val(val);
			$.powerFloat.hide();
	}
	
	function tpl_list(id){
		var list = [ 
		<!--foreach:{$tpl_list $vo}-->
		{
			href: "javascript:tpl_val('"+id+"','{$vo}');",
			text: "{$vo}"
		},
		<!--{/foreach}-->
		{
			text: "请选择使用模板"
		}];
		return list;
	}
	
	function themes_list(id){
	var list = [ 
		<!--foreach:{$themes_list $vo}-->
		{
			href: "javascript:tpl_val('"+id+"','{$vo}');",
			text: "{$vo}"
		},
		<!--{/foreach}-->
		{
			text: "请选择默认模板"
		}];
		return list;
	}
	
	function tpl_power(id){
		$("#"+id).powerFloat({
			width: 308,
			eventType: "click",
			edgeAdjust:false,
			reverseSharp:true,
			target:tpl_list(id),
			targetMode: "list"
		});
	}
	
	$("#TPL_TEMPLATE_NAME").powerFloat({
		width: 308,
		eventType: "click",
		edgeAdjust:false,
		reverseSharp:true,
		target:themes_list('TPL_TEMPLATE_NAME'),
		targetMode: "list"
	});
	
	tpl_power("TPL_TEMPLATE_INDEX");
	tpl_power("TPL_TEMPLATE_COMMON");
	tpl_power("TPL_TEMPLATE_SEARCH");
	tpl_power("TPL_TEMPLATE_TAG");
	tpl_power("TPL_TEMPLATE_TAG_INDEX");

});

</script>